<?php

function __autoload($class_name) {
    if (preg_match("#Model_#", $class_name)) {
        $name = str_replace("Model_", "", $class_name);
        include_once APP_PATH .'/models/' . $name . '.php';
    } else {
        require_once 'libs/' . $class_name . '.php';
    }
}